<?php
namespace Admin\Model;
use Think\Model;

class FindpwdModel extends Model {


	/**
	 * 验证找回密码链接中的信息是否正确
	 * @param  [type] $role    [description]
	 * @param  [type] $account [description]
	 * @param  [type] $rand    [description]
	 * @return [type]          [description]
	 */
	public function checkInfo($role,$account,$rand) {

		$map['role'] = $role;
		$map['account'] = $account;
		$map['rand'] = $rand;

		$result = $this->where($map)->find();

		if (empty($result)) return false;

		$now = time();
		$diff = $now - strtotime($result['send_time']);
		$minute = intval(bcdiv ( $diff ,60));
		if ($minute > 30) return false;

		return true;
	}


}